/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UserInterface;

import Controller.Edge;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;

/**
 *
 * @author subx
 */
public class LineShape extends Shape {

    private Point start;
    private Point end;
    private Color color;

    
    public LineShape() {
    }

    public LineShape(Point start, Point end, Color color) {
        this.start = start;
        this.end = end;
        this.color = color;
    }

    public LineShape(Edge e){
        this.start = e.getStart();
        this.end = e.getEnd();
        this.color = Color.BLUE;
    }

    public Point getEnd() {
        return end;
    }

    public void setEnd(Point end) {
        this.end = end;
    }

    public Point getStart() {
        return start;
    }

    public void setStart(Point start) {
        this.start = start;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    @Override
    public void draw(Canvas c) {
        Graphics g = c.getGraphics();

        g.setColor(getColor());
        g.drawLine(getStart().y + 10, getStart().x + 10, getEnd().y + 10, getEnd().x + 10);
    }

}
